package edu.usx.server.service;

import edu.usx.server.pojo.User;
import com.baomidou.mybatisplus.extension.service.IService;
import edu.usx.server.pojo.RespBean;
import edu.usx.server.pojo.dto.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author RawMieEgg
 */
public interface IUserService extends IService<User> {
    /**
     * 实现登录功能
     * @param username
     * @param password
     * @param request
     * @return
     */
    public RespBean login(String username, String password, String code, HttpServletRequest request);

    /**
     * 根据用户名获取完整用户对象
     * @param username
     * @return
     */
    public User getUserByUserName(String username);

    /**
     * 根据用户id来修改用户信息
     *
     * @param user
     * @return
     */
    RespBean updateById(UserDto user);

    /**
     * 用户注册
     *
     * @param user
     * @return
     */

    public RespBean register(UserregisterDto user, HttpServletRequest request);


    /**
     * 根据邮箱查找用户
     * @param email
     * @return
     */
    public User getUserByUserEmail(String email);

    /**
     * 邮箱验证码验证重置密码
     * @return
     */
    public RespBean resetPasswordByEmail(UserResetPwdDto userResetPwdDto, HttpServletRequest request);

    /**
     * 修改密码
     * @return
     */
    public RespBean updatePassword(UpdatePwdDto updatePwdDto);

    /**
     * 图片上传
     * @return
     */
    public RespBean uploadImage(MultipartFile file);

}
